﻿/**
* Vista asociada al contenido 
* del tab de la funcionalidad LOGIN
* en el aplicativo.
*/
Ext.define("entgpv11.view.MainContainer.Login", {
    extend: "Ext.form.Panel",
    requires:"Ext.form.FieldSet",
    alias: "widget.login",
    config: {
        scrollable: 'vertical'
    },
    initialize: function () {

        this.callParent(arguments);
        var lblInfo ={
			xtype: 'fieldset',
			title: 'Inicio',
			instructions: 'Service Project',
		};
		var txtUser ={
			xtype: 'textfield',
			id: 'sUser',
			name: 'sUser',
			label: 'Usuario',
			required: true
		};	
        var txtPass ={
			xtype: 'passwordfield',
			id: 'sPass',
			name: 'sPass',
			label: 'Clave',
			required: true
		};
        var loginButton = {
            xtype: "button",
            id: "btnLogin",
             ui: 'action',
            text: "Aceptar",
            handler: this.onLogin,
            scope: this
        };		
        this.add([
		     lblInfo,
            { xtype: "fieldset",
                items: [txtUser,txtPass,loginButton]
            }
        ]);
    },
	onLogin: function () {
        //console.log("1.-onLogin");
		this.fireEvent("loginCommand", this);
    }
});

